<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.1.0.min.js"></script>
</head>
<body>
<div class="a">custome</div>
<p style="background: blue;" class="blue">在别的地方触发自定义事件</p>
<script>
    // event
    var evhandle=new Event('custome');
    $('.a')[0].addEventListener('custome',function () {
        console.log('constome')
    })
    $('.a').on('click',function () {
        $('.a')[0].dispatchEvent(evhandle);
    })

    $('.blue').on('click',function () {
        $('.a')[0].dispatchEvent(evhandle);
    })
    // customEvent
    // customEvent 可以指定事件名，外带options参数
</script>
</body>
</html>